﻿using UnityEngine;


namespace BackpackSystem
{
    /// <summary>
    /// 
    /// </summary>
    public class ItemLoader
    {

        public static T Load<T>(string assetName) where T : UnityEngine.Object
        {
            if (typeof(T).Name == "GameObject")
            {
                return Resources.Load<T>($"Backpack System/Inventory/{assetName}");
            }

            if (typeof(T).Name == "Sprite")
            {
                return Resources.Load<T>($"Backpack System/Icon/{assetName}");
            }


            return null;
        }



    }
}
